package com.study.spring.ch06;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

public class MyExceptionHandler implements HandlerExceptionResolver{
	public ModelAndView resolveException(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception ex) {
			  if(ex instanceof NullPointerException){
			    //�����д��δ���,����:����־
			    System.out.println("now is NullPointer");
			  }else if(ex instanceof ArrayIndexOutOfBoundsException){
			    //�����д��δ���,����:����־
			  }
			  
			  return new ModelAndView("errors").addObject("ex", ex);
			 }
}
